// file name: depth-first-search.cpp
// description: a cpp file that implements a depth-first search
// last editor: sunist chan
// macOS Catalina 10.15.5 with Visual Studio Code and GCC11
// complie command: g++ depth-first-search.cpp -o YOUR_PROGRAM_NAME

#include <iostream>

class edge
{
    public:
    int index_a;
    int index_b;
};

bool all_visited(bool *visited, int node_count)
{
    for (int i = 0; i < node_count; i++)
    {
        if (visited[i] == false)
        {
            return false;
        }
    }
    return true;
}

void DFS(edge *edges, int index, bool *visited, int find_index, int node_count)
{
    if (index == find_index)
    {
        std::cout << "FIND IT!\n";
        exit(0);
    }
    else if (all_visited(visited, node_count))
    {
        std::cout << "NOT FOUND!\n";
        exit(0);
    }

    if (edges[index].index_b == -1 || edges[index].index_b == -1)
    {
        return;
    }
    else
    {
        visited[index] = true;
        DFS(edges, edges[index].index_b, visited, find_index, node_count);
        visited[index] = false;
    }
}

int main()
{
    int edge_count, node_count;
    std::cin >> node_count >> edge_count;

    edge *edges = new edge[edge_count];
    bool *visited = new bool[node_count];

    for (int i = 0; i < node_count; i++)
    {
        visited[i] = false;
    }

    int start_index, find_index;
    std::cin >> start_index >> find_index;

    for (int i = 0; i < edge_count; i++)
    {
        std::cin >> edges[i].index_a >> edges[i].index_b;
    }

    DFS(edges, start_index, visited, find_index, node_count);

    return 0;
}